# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=python-camel-converter
pkgver=3.0.2
pkgrel=1
pkgdesc='Converts a string from snake case to camel case or camel case to snake case'
arch=(any)
license=('MIT')
url='https://github.com/sanders41/camel-converter'
depends=(python)
makedepends=(python-poetry-core)
makedepends=(python-build python-installer python-wheel python-poetry-core)
checkdepends=(python-pytest python-pydantic)
optdepends=('python-pydantic: provides a base class to automatically convert between snake and camel case')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/sanders41/camel-converter/archive/refs/tags/v${pkgver}.tar.gz)
sha512sums=('44daa2443147bf849c216de499b225bd68cae998fe1cfbf03773ded51f1694ee35334d0d59b45f24241fc564a4d53ff70a0d87e8c19ac265ab6eee6aca53e3a7')

build() {
  cd "camel-converter-${pkgver}"
  python -m build --wheel --no-isolation
}

check() {
  cd "camel-converter-${pkgver}"
  python -m unittest discover -vs tests
}

package() {
  cd "camel-converter-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
